<?php
namespace AiSPRDocManager\Controller;

use AiSPRDocManager\Controller\Base as Base;
use AiSPRDocManager\Model as AiCMModel;

/**
 * Description of Home
 *
 * @author Asfer <rmasfer@gmail.com>
 */
class Home extends Base {

	const MENU_SLUG = 'sprdocmanager';
	const MENU_ICON = '';
	const MENU_POSITION = 1437.3636;


	public function initialise() {
		$sHookName = add_menu_page(
			'SPR Doc Manager',
			'SPR Doc Manager',
			'edit_pages',
			self::MENU_SLUG,
			array($this, 'page'),
			self::MENU_ICON,
			self::MENU_POSITION
		);

		add_action('admin_print_scripts-' . $sHookName, array($this, 'enqueueBootstrapJs'));
		add_action('admin_print_scripts-' . $sHookName, array($this, 'enqueDataTableJs'));
		add_action('admin_print_scripts-' . $sHookName, array($this, 'enqueAdminJs'));

		
		add_action('admin_print_styles-' . $sHookName, array($this, 'enqueueBootstrapCss'));
		// add_action('admin_print_styles-' . $sHookName, array($this, 'enqueDataTableCss'));
		add_action('admin_print_styles-' . $sHookName, array($this, 'enqueueAdminCss'));
		add_action('admin_print_styles-' . $sHookName, array($this, 'enqueDataTableCustomCss'));



	}

	public function page() {
		$aContent = array();

		$oCvModel = new AiCMModel\Cv();
		$aContent =$oCvModel->action();

		include_once aiCvManager_Plugin_Dir . '/src/view/home.php';
	}

	public function enqueAdminJs () {
		wp_enqueue_script('admin_js', aiCvManager_Plugin_Url . '/assets/js/admin.js', array('jquery'));
		// wp_enqueue_script('dataTable_js');
	}



}

?>